# coding: utf-8
from . import db, BaseModel


class Notice(db.Model):
    __tablename__ = 'notice'

    auto_id = db.Column(db.BigInteger, primary_key=True, info='自增id')
    notice_id = db.Column(db.BigInteger, nullable=False, info='公告id')
    publisher_id = db.Column(db.BigInteger, nullable=False, info='发布者id')
    title = db.Column(db.String(50, 'utf8mb4_0900_ai_ci'), nullable=False, server_default=db.FetchedValue(), info='公告标题')
    content = db.Column(db.Text(collation='utf8mb4_0900_ai_ci'), nullable=False, info='内容')
    notice_file_url = db.Column(db.String(500, 'utf8mb4_general_ci'), info='附件地址')
    status = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='通知状态 0- 下线 1- 发布')
    publish_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='发布时间')
    is_recommend = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='推荐位')
    is_delete = db.Column(db.Integer, nullable=False, server_default=db.FetchedValue(), info='逻辑删除')
    create_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='创建时间')
    update_time = db.Column(db.DateTime, nullable=False, server_default=db.FetchedValue(), info='更新时间')
